<?php echo script::add('jquery'); ?>
<script type="text/javascript">$(document).ready(function(){$('#submit_button').click(function(){var user_name=$('#user_name_box').val();var password=$('#user_password_box').val();var confirm_password=$('#confirm_password_box').val();var email=$('#user_email_box').val();var nickname=$('#user_nickname_box').val();if(user_name==''){alert('用户名不能为空!');$('#user_name_box').focus();return false;}if(password==''){alert('密码不能为空!');$('#user_password_box').focus();return false;}if(password!=confirm_password){alert('确认密码与密码不一致,请重新设置');return false;}if(email==''){alert('邮箱不能为空!');$('#user_email_box').focus();return false;}$.post('<?php echo $this->get_action_url('ajax_insert_user'); ?>', {name:user_name,password:password,email:email,nickname:nickname}, function(data){if(data==101){alert('恭喜!用户添加成功!');location.href='<?php echo $this->get_action_url('index'); ?>'}else{alert(data);}});});});</script>
<table width="800" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="30" align="left">>><?php echo $site_name; ?></td>
      </tr>
      <tr>
        <td align="left" valign="top"><table width="100%" border="0" cellspacing="5" cellpadding="0">
          <tr>
            <td width="85" height="30" align="center">&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td width="85" height="30" align="right">用户名：</td>
            <td><input type="text" name="user_name" id="user_name_box" />&nbsp;(必填)</td>
          </tr>
          <tr>
            <td height="30" align="right">密码：</td>
            <td><input type="password" name="user_password" id="user_password_box" />
            &nbsp;(必填)</td>
          </tr>
          <tr>
            <td height="30" align="right">确认密码：</td>
            <td><input type="password" name="confirm_password" id="confirm_password_box" />
            &nbsp;(必填)</td>
          </tr>
          <tr>
            <td height="30" align="right">邮箱：</td>
            <td><input type="text" name="user_email" id="user_email_box" />&nbsp;(必填)</td>
          </tr>
          <tr>
            <td height="30" align="right">昵称：</td>
            <td><input type="text" name="user_nickname" id="user_nickname_box" />&nbsp;(可选)</td>
          </tr>
          <tr>
            <td height="30" align="center">&nbsp;</td>
            <td><input type="button" name="submit_button" id="submit_button" value="提交"/></td>
          </tr>
        </table></td>
      </tr>
</table>